<%@language=vbscript%>
<%
	Session("bChucnang")=13
	Session("FormName")="F19"
%>
<!--#include file="..\CheckSession.inc"-->
<!--#include file="..\RootContent.inc"-->
<!--#include file=..\getFormName.inc-->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Y kien lanh dao</title>
</head>
<%	
bComm=Request("bComm")
idvtden=Request("idvtden")
bngayht=Request("bngayht")
bkqxl=Request("bkqxl")
if bComm="add" then
		sSQl="delete hoanthanhxl where idvtden='"& idvtden &"' and madonvi='"& Session("bMaDonVi") &"'"
		Conn.Execute sSQL
		sSQl="insert into hoanthanhxl(idvtden,idvtdi,ngayhtxl,madonvi,kqxl,trangthai) values ('"& idvtden &"','','"& SaveDate(bngayht) &"','"& Session("bMaDonVi") &"','"& bkqxl &"',0)"
		Conn.Execute sSQL

end if
sSQl="select * from hoanthanhxl where idvtden='"& idvtden &"' and madonvi='"& Session("bMaDonVi") &"'"
	Set Rec=server.CreateObject("ADODB.Recordset")
	Rec.CursorType=3
	Rec.CacheSize=5
	Rec.Open sSQL,Conn
	if Rec.RecordCount > 0 then
		bkqxl=Rec("kqxl")	
	end if
	Rec.Close
	Set Rec= nothing
%>	
<!--#include file="..\jvfunction.inc"-->
<script language=vbscript runat=server>
	Function SaveDate(vDate)
		dim bvitri1
		dim bvitri2
	   if vDate<>"" then
		   vDate=trim(cstr(vDate))
		   bvitri1=instr(1,vDate,"/")
		   bMonth=left(vDate,bvitri1-1)
		   bvitri2=instr(bvitri1+1,vDate,"/")
		   Dim Temp
		   Temp=right(vDate,len(vDate)-bvitri1)
		   bDay=left(Temp,bvitri2-bvitri1-1)
		   bYear=right(vDate,len(vDate)-bvitri2)
		   SaveDate=bDay+"/"+bMonth+"/"+bYear
	   else
	       SaveDate=""
	   end if
	End Function
	Function FormatDate(vDate)
	   If vDate <> "" Then
	        vM = Right("0" & Month(vDate), 2)
	        vD = Right("0" & Day(vDate), 2)
	        vY = Right("19" & Year(vDate), 4)
	        FormatDate = vD & "/" & vM & "/" & vY
		Else
			FormatDate=""
	   End If
	End Function
	Function ModiString(mess_s)
		message = Replace("" & mess_s,"'", "''")
		ModiString=message
	End function
</script>	
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function CmdOK_onclick() {
		kqxl=Noidung.TxtKQXL.value;
		window.Noidung.target="right"
		window.Noidung.action="frmketquaxuly.asp?idvtden="+"<%=idvtden%>"+"&bcomm=add"+"&bngayht="+"<%=bngayht%>"+"&bkqxl="+kqxl;
		window.Noidung.submit()
}
function CmdExit_onclick(){
	window.Noidung.target="right";
	window.Noidung.action="<%=Session("tenvtden")%>";
	window.Noidung.submit();
}
//-->
</SCRIPT>
<body bgcolor=#F8F9D9 topmargin="0" leftmargin="0" style="font-family:times new roman">
<form name=Noidung method=post>
<table border="0" cellspacing="0" style="font-size:12pt" width="100%" bgcolor="#F8F9D9">
<tr>
    <td width="100%" colspan="2" bgcolor="#000080">
    <p align="center"><font color="#FFFFFF"><span style="font-size: 11pt"><b>HOÀN THÀNH XỬ LÝ</b></span></font></td>
</tr>
<tr>
    <td width="17%" valign=top align="center">Kết quả xử lý</TD>
	<td width="83%"><textarea name=TxtKQXL maxLength=500 style='font-family:Arial; width:100%' rows=4 cols=82 tabindex=3><%=bkqxl%></textarea></td>
</tr>
<tr>

</tr>
</table>
<table width="100%" border="0" cellspacing="4" style="font-size:13pt" bgcolor="#F8F9D9">
</tr>
	<td width="35%"></td>
	<td width="15%"><Button name="CmdOK" style="font-family:Arial;width: 100%"  LANGUAGE=javascript onclick="return CmdOK_onclick()" accesskey="G" tabindex=4><p><u>G</u>hi nhận</p></Button></td>
	<td width="15%"><Button name="CmdExit" style="font-family: Arial;width: 100%" LANGUAGE=javascript onclick="return CmdExit_onclick()" accesskey="Y" tabindex=5><p>Qua<u>y</u> lại</p></Button></td>
	<td width="35%"></td>
</tr>
</Table>
</form>
</body>
</html>
<%
	Conn.Close
	set Conn=nothing
%>